import matplotlib.pyplot as plt
# Sample data (Year-wise % of population with access to clean water & sanitation)
years = [2010, 2012, 2014, 2016, 2018, 2020, 2022]
clean_water = [50, 64, 67, 80, 83, 86, 89] # Percentage of population
sanitation = [55, 59, 62, 56, 70, 74, 78]
# Create the line chart
plt.figure(figsize=(10, 6))
plt.plot(years, clean_water, label='Access to Clean Water (%)', color='blue')
plt.plot(years, sanitation, label='Access to Sanitation (%)', color='green')
# Chart title and labels
plt.title('Progress in Clean Water and Sanitation Access (2010–2022)', fontsize=14)
plt.xlabel('Year', fontsize=12)
plt.ylabel('Percentage of Population (%)', fontsize=12)
plt.legend()
plt.tight_layout()
# Show the chart
plt.show()